package com.wang.util;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ExecutorServiceUtil {


    private static ExecutorService instance;


    //让构造函数为 private，这样该类就不会被实例化
    private ExecutorServiceUtil() {
    }

    public static ExecutorService getInstance() {

        if (instance == null) {
            instance = Executors.newFixedThreadPool(2);
        }
        return instance;

    }
}
